package edu.fpa.day0725;
import java.io.File;

public class DirDemo04 {
    public static void main(String[] args) {
        File dir = new File("D:/zhuanyeruanjian/yichang/src/cn/sxt");
        count(dir);
        System.out.println(len);
    }
    public static int len = 0;
    public static void count(File f) {
        if(f!=null && f.exists()) {
            if(f.isFile()) {
                len+=f.length();
            }else {
                for(File ff:f.listFiles()) {
                    count(ff);
                }
            }

        }
    }
}